package com.mytaobao.main.firsttab.func.flashsale;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.mytaobao.R;
import com.tmall.wireless.tangram.structure.BaseCell;
import com.tmall.wireless.tangram.structure.view.ITangramViewLifeCycle;

/**
 * Created by hp on 2017/7/7.
 */

public class FlashSaleViewMiddleTitle extends FlashSaleViewLR implements ITangramViewLifeCycle {

    private TextView tvMiddeleTitle;

    public FlashSaleViewMiddleTitle(Context context) {
        super(context);
        initMiddleTitle();
    }

    public FlashSaleViewMiddleTitle(Context context, AttributeSet attrs) {
        super(context, attrs);
        initMiddleTitle();
    }

    public FlashSaleViewMiddleTitle(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initMiddleTitle();
    }

    private void initMiddleTitle() {
        tvMiddeleTitle = new TextView(getContext());
        tvMiddeleTitle.setTextColor(getResources().getColor(R.color.font66));
        ((LinearLayout)this.findViewById(R.id.rlr_ll_left)).addView(tvMiddeleTitle, 1);
    }

    @Override
    public void cellInited(BaseCell cell) {

    }

    @Override
    public void postBindView(BaseCell cell) {
        super.setBaseData(cell);
        tvMiddeleTitle.setText(cell.optStringParam("middleTitle"));
    }

    @Override
    public void postUnBindView(BaseCell cell) {

    }


}
